//
// Created by he on 2024/1/4.
//

#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>

int main(int argc, char * argv[])
{
    int fd;
    char buf[64]  = {0};
    char buf2[32] = "nohaoa";
    fd            = open("/dev/test", O_RDWR);
    if(fd < 0) {
        printf("open error\n");
        return fd;
    }
    read(fd, buf, 32);
    printf("%s", buf);

    write(fd, buf2, 32);
    close(fd);

    return 0;
}